<?php
?>
<!-- BEGIN pdoaj_form -->
<!--%FormStart%-->
<form name='autofrm_<?php print $name ?>' method='get' action='<?php print $actionurl ?>'>
<!--END-->

<!--%ctls%-->

<!--END-->

<!--%FormSel%-->
<input type='hidden' value='<?php print $name ?>' name='sel' />
<!--END-->

<input type='submit' value='' name='mode' />
</form>
<script type="text/javascript">
// inputs:
/*%BindForm%*/
	$('#frm_employees').bind('submit',function() { 
		var data = $(this).serialize();
		alert(data);
		$.get("slickemp/slickemp_proc.php?" +  data,function(responce){
			alert(responce.status);
			},'json');
	  return false;
	  }
	);
/*END*/

/*%AddHandler%*/	
function SE_Add_employees_form(valuekey){

	var url_values = ''; //"slickemp/slickemp_proc.php?mode=jprow&sel=slickemp&jsoncallback=?&employeeNumber=" + valuekey;
	var ar_url_lists = [];
	ar_url_lists['reportsTo'] = "http://localhost/system3/webapp/slickemp/slickemp_proc.php?mode=jsonlookup&sel=slickemp&col=reportsTo";
	ar_url_lists['officeCode'] = "http://localhost/system3/webapp/slickemp/slickemp_proc.php?mode=jsonlookup&sel=slickemp&col=officeCode";

	$('#frm_employees').append("<input type='hidden' name='mode' value='Add' />").find(':submit').val("Add");
	
	SetupForm('frm_employees',url_values,ar_url_lists);	
}
/*END*/
/*%EditHandler%*/
function SE_Edit_employees_form(valuekey){

	var url_values = "slickemp/slickemp_proc.php?mode=jprow&sel=slickemp&jsoncallback=?&employeeNumber=" + valuekey;
	var ar_url_lists = [];
	ar_url_lists['reportsTo'] = "http://localhost/system3/webapp/slickemp/slickemp_proc.php?mode=jsonlookup&sel=slickemp&col=reportsTo";
	ar_url_lists['officeCode'] = "http://localhost/system3/webapp/slickemp/slickemp_proc.php?mode=jsonlookup&sel=slickemp&col=officeCode";
	$('#frm_employees').append("<input type='hidden' name='employeeNumber' value='" + valuekey + "' />");
	$('#frm_employees').append("<input type='hidden' name='mode' value='Change' />").find(':submit').val("Update");
	
	SetupForm('frm_employees',url_values,ar_url_lists);	
}
/*END*/

</script>
<!-- END pdoaj_form -->
